package com.jueyunqi.producer;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Service;

@Service("messageProducer")
public class MessageProducer {
	private Logger logger = LoggerFactory.getLogger(MessageProducer.class);
	
	@Resource
	private AmqpTemplate amqpTemplate;
	
	public void sendMessage(Object message){
		amqpTemplate.convertAndSend("queueTestKey",message);
		logger.info("producer send msg:{}",message);
	}
}
